package com.ruoyi.trainingManagement.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.trainingManagement.mapper.CourseAdjustmentRecordMapper;
import com.ruoyi.trainingManagement.domain.CourseAdjustmentRecord;
import com.ruoyi.trainingManagement.service.ICourseAdjustmentRecordService;

/**
 * 调整课程记录表Service业务层处理
 * 
 * @author chenxl
 * @date 2025-08-14
 */
@Service
public class CourseAdjustmentRecordServiceImpl implements ICourseAdjustmentRecordService 
{
    @Autowired
    private CourseAdjustmentRecordMapper courseAdjustmentRecordMapper;

    /**
     * 查询调整课程记录表
     * 
     * @param id 调整课程记录表主键
     * @return 调整课程记录表
     */
    @Override
    public CourseAdjustmentRecord selectCourseAdjustmentRecordById(String id)
    {
        return courseAdjustmentRecordMapper.selectCourseAdjustmentRecordById(id);
    }

    /**
     * 查询调整课程记录表列表
     * 
     * @param courseAdjustmentRecord 调整课程记录表
     * @return 调整课程记录表
     */
    @Override
    public List<CourseAdjustmentRecord> selectCourseAdjustmentRecordList(CourseAdjustmentRecord courseAdjustmentRecord)
    {
        return courseAdjustmentRecordMapper.selectCourseAdjustmentRecordList(courseAdjustmentRecord);
    }

    /**
     * 新增调整课程记录表
     * 
     * @param courseAdjustmentRecord 调整课程记录表
     * @return 结果
     */
    @Override
    public int insertCourseAdjustmentRecord(CourseAdjustmentRecord courseAdjustmentRecord)
    {
        courseAdjustmentRecord.setId(IdUtils.fastUUID());
        return courseAdjustmentRecordMapper.insertCourseAdjustmentRecord(courseAdjustmentRecord);
    }

    /**
     * 修改调整课程记录表
     * 
     * @param courseAdjustmentRecord 调整课程记录表
     * @return 结果
     */
    @Override
    public int updateCourseAdjustmentRecord(CourseAdjustmentRecord courseAdjustmentRecord)
    {
        return courseAdjustmentRecordMapper.updateCourseAdjustmentRecord(courseAdjustmentRecord);
    }

    /**
     * 批量删除调整课程记录表
     * 
     * @param ids 需要删除的调整课程记录表主键
     * @return 结果
     */
    @Override
    public int deleteCourseAdjustmentRecordByIds(String[] ids)
    {
        return courseAdjustmentRecordMapper.deleteCourseAdjustmentRecordByIds(ids);
    }

    /**
     * 删除调整课程记录表信息
     * 
     * @param id 调整课程记录表主键
     * @return 结果
     */
    @Override
    public int deleteCourseAdjustmentRecordById(String id)
    {
        return courseAdjustmentRecordMapper.deleteCourseAdjustmentRecordById(id);
    }

    /**
     * 通过原教师ID查询所有对应的调整记录
     * @param originalTeacherId 原教师ID
     * @return 调整记录列表
     */
    @Override
    public List<CourseAdjustmentRecord> selectAdjustmentRecordByOriginalTeacherId(String originalTeacherId) {
        return courseAdjustmentRecordMapper.selectByOriginalTeacherId(originalTeacherId);
    }
    /**
     * 通过courseScheduleDetailsId列表查询调课记录
     * @param courseScheduleDetailsIds courseScheduleDetailsId列表
     * @return 调课记录列表
     */
    @Override
    public List<CourseAdjustmentRecord> selectAdjustmentRecordByCourseScheduleDetailsIds(List<String> courseScheduleDetailsIds) {
        return courseAdjustmentRecordMapper.selectByCourseScheduleDetailsIds(courseScheduleDetailsIds);
    }
}
